package Arduino;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import gnu.io.CommPortIdentifier;
import gnu.io.SerialPort;
import gnu.io.SerialPortEvent;
import gnu.io.SerialPortEventListener;
import java.util.Enumeration;
import Arduino.SerialClass;
import Arduino.SerialClass;
import java.io.IOException;

public class TestBis {
	public static BufferedReader input;
	public static OutputStream output;

	public static synchronized void writeData(String data) {
		System.out.println("Sent: " + data);

		try {
			output.write(data.getBytes());
		} catch (Exception e) {
			System.out.println("could not write to port");
		}
	}

	public static void main(String[] ag) {

		try {
			SerialClass obj = new SerialClass();
			obj.initialize();
			input = SerialClass.input;
			output = SerialClass.output;
		
			
			//* Da kann man der Value an der arduino schicken. 
			//* einfach mit "writeData(value).
			
			String inputLine = input.readLine();
			System.out.println(inputLine);

			obj.close();
		} catch (Exception e) {
		}

	}
}
